#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n;



int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;
    int n1 = 0, n2 = 0;
    for(int i = 1, x; i <= n; i ++){
        cin >> x;
        if(x == 1) n1 ++;
        else n2 ++;
    }

    if(n2){
        cout << 2 << " ";
        n2 --;
    }

    if(n1){
        cout << 1 << " ";
        n1 --;
    }

    for(int i = 1; i <= n2; i ++){
        cout << 2 << " ";
    }

    for(int i = 1; i <= n1; i ++){
        cout << 1 <<  " ";
    }


    

    return 0;
}